@extends('layout.default')

@section('layout.content')
  <div class="row">
    <div class="col-xs-12">
      <a class="btn btn-primary" href="{{route('system.staff.create')}}"><i class="ace-icon fa fa-plus"></i>人员</a>
    </div>
  </div>
  <div class="space-4"></div>
  <div class="row">
    <div class="col-xs-12">
      <table class="table table-hover table-bordered table-striped">
        <thead>
        <tr>
          <th style="width:100px;">账号</th>
          <th style="width:90px;">名称</th>
          <th style="width:130px;">所属分支</th>
          <th>角色</th>
          <th class="align-right" style="width:110px;">操作</th>
        </tr>
        </thead>

        <tbody>
        @foreach ($staffs as $key=>$staff)
          <tr>
            <td>{{ $staff->username }}</td>
            <td>{{ $staff->name }}</td>
            <td>{{ $staff->branch->name }}</td>
            <td>{{ $staff->roles()->pluck('name')->implode(' ') }}</td>
            <td class="align-right">
              <a href="{{route('system.staff.edit', $staff->id)}}" class="btn-add btn btn-minier btn-light"
                 style="margin-right:5px;">修改</a>
              <button type="button" class="btn-delete btn btn-minier btn-light">删除</button>
            </td>
          </tr>
        @endforeach
        </tbody>
      </table>

    </div><!-- /.col -->
  </div><!-- /.row -->

@stop

@section('javascript')

@stop